package com.zjl.workflow.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zjl.workflow.entity.Person;
import com.zjl.workflow.repository.mapper.PersonMapper;
import org.springframework.stereotype.Repository;

@Repository
public class PersonRepository extends ServiceImpl<PersonMapper, Person> {

    public Person findByUsername(String username) {
        LambdaQueryWrapper<Person> queryWrapper = new QueryWrapper<Person>().lambda()
                .eq(Person::getUsername, username);
        return super.getOne(queryWrapper);
    }
}